package com.ruoyi.supplier.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.supplier.mapper.SysSupplierMapper;
import com.ruoyi.supplier.domain.SysSupplier;
import com.ruoyi.supplier.service.ISysSupplierService;

/**
 * 供应商管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-28
 */
@Service
public class SysSupplierServiceImpl implements ISysSupplierService 
{
    @Autowired
    private SysSupplierMapper sysSupplierMapper;

    /**
     * 查询供应商管理
     * 
     * @param id 供应商管理主键
     * @return 供应商管理
     */
    @Override
    public SysSupplier selectSysSupplierById(Long id)
    {
        return sysSupplierMapper.selectSysSupplierById(id);
    }

    @Override
    public SysSupplier selectSysSupplierBySupplierName(String supplierName) {
        return sysSupplierMapper.selectSysSupplierBySupplierName(supplierName);
    }

    /**
     * 查询供应商管理列表
     * 
     * @param sysSupplier 供应商管理
     * @return 供应商管理
     */
    @Override
    public List<SysSupplier> selectSysSupplierList(SysSupplier sysSupplier)
    {
        return sysSupplierMapper.selectSysSupplierList(sysSupplier);
    }

    /**
     * 新增供应商管理
     * 
     * @param sysSupplier 供应商管理
     * @return 结果
     */
    @Override
    public int insertSysSupplier(SysSupplier sysSupplier)
    {
        sysSupplier.setCreateTime(DateUtils.getNowDate());
        return sysSupplierMapper.insertSysSupplier(sysSupplier);
    }

    /**
     * 修改供应商管理
     * 
     * @param sysSupplier 供应商管理
     * @return 结果
     */
    @Override
    public int updateSysSupplier(SysSupplier sysSupplier)
    {
        sysSupplier.setUpdateTime(DateUtils.getNowDate());
        return sysSupplierMapper.updateSysSupplier(sysSupplier);
    }

    /**
     * 批量删除供应商管理
     * 
     * @param ids 需要删除的供应商管理主键
     * @return 结果
     */
    @Override
    public int deleteSysSupplierByIds(Long[] ids)
    {
        return sysSupplierMapper.deleteSysSupplierByIds(ids);
    }

    /**
     * 删除供应商管理信息
     * 
     * @param id 供应商管理主键
     * @return 结果
     */
    @Override
    public int deleteSysSupplierById(Long id)
    {
        return sysSupplierMapper.deleteSysSupplierById(id);
    }
}
